class fire_m67ThrowOverHand extends TFProjectileFire;

var class<DamageType> DamageType;       // weapon fire damage type (no projectile, so we put this here)
var float ThrowRange;                  // from pawn centre
var float speedMultiplier; // how much to multiply the projectile speed by
var float FireSoundIntensity;// how loud to alert other bots/AI to

function DrawMuzzleFlash(Canvas Canvas){}

function Rotator AdjustAim(Vector Start, float InAimError){
	local rotator Aim, EnemyAim;

	if ( AIController(Instigator.Controller) != None )
	{
		Aim = Instigator.Rotation;
		if ( Instigator.Controller.Enemy != None )
		{
			EnemyAim = rotator(Instigator.Controller.Enemy.Location - Start);
			Aim.Pitch = EnemyAim.Pitch;
		}
		return Aim;
	}
	else
		return super.AdjustAim(Start,InAimError);
}

function DoFireEffect()
{
    local Vector StartProj, StartTrace, X,Y,Z;
    local Rotator Aim;
    local Vector HitLocation, HitNormal;
    local Actor Other;
    local int SpawnCount;

    Instigator.MakeNoise(FireSoundIntensity);
    Weapon.GetViewAxes(X,Y,Z);

    StartTrace = Instigator.Location + Instigator.EyePosition();
    StartProj = StartTrace + X*ProjSpawnOffset.X;
    if ( !Weapon.WeaponCentered() )
	    StartProj = StartProj + Weapon.Hand * Y*ProjSpawnOffset.Y + Z*ProjSpawnOffset.Z;

    // check if projectile would spawn through a wall and adjust start location accordingly
    Other = Weapon.Trace(HitLocation, HitNormal, StartProj, StartTrace, false);
    if (Other != None)
    {
        StartProj = HitLocation;
    }

    Aim = AdjustAim(StartProj, AimError);
    SpawnCount = Max(1, ProjPerFire * int(Load));
    SpawnProjectile(StartProj, Aim);
}


function projectile SpawnProjectile(Vector Start, Rotator Dir){
    local Projectile Boom;

    GotoState('');
    return Boom;
}



function float MaxRange(){
	return ThrowRange;
}

defaultproperties
{
     ThrowRange=600.000000
     speedMultiplier=1.100000
     FireSoundIntensity=0.050000
     ProjSpawnOffset=(X=25.000000,Y=9.000000,Z=-12.000000)
     bSplashDamage=True
     bRecommendSplashDamage=True
     bTossed=True
     bFireOnRelease=True
     TransientSoundVolume=1.000000
     PreFireAnim="pull_pin_oh"
     FireAnim="throw_oh"
     FireLoopAnim="fire_overhand"
     FireEndAnim="idle_S"
     TweenTime=0.000000
     FireSound=Sound'SkaarjPack_rc.Manta.fly1m'
     FireRate=0.800000
     AmmoClass=Class'taskforces.ammo_proxyMine'
     AmmoPerFire=1
     ProjectileClass=Class'taskforces.proxyMine'
     BotRefireRate=0.250000
     WarnTargetPct=0.100000
}
